#ifndef WIDGET_FUNCB_SMART_VISION_H
#define WIDGET_FUNCB_SMART_VISION_H

#include <QWidget>
#include "button_home_Start.h"
#include <QTcpSocket>
#include <QMovie>

namespace Ui {
class Widget_funcB_Smart_vision;
}

class Widget_funcB_Smart_vision : public QWidget
{
    Q_OBJECT

public:
    explicit Widget_funcB_Smart_vision(QWidget *parent = nullptr);
    ~Widget_funcB_Smart_vision();
protected slots:
    void slots_button_start(bool start);
    void slots_button_send_message();
    void slots_button_getup(bool start);
    void slots_button_sleep(bool start);

    // TCP 相关
    void connectToServer();
    void onReadyRead();
    void onDisconnected();
    void handleReceivedCommand(const QString &msg);
    void sendMessage(const QString &msg);

private:
    Ui::Widget_funcB_Smart_vision *ui;

    // 新增：动态图播放相关成员
    QMovie *gifMovie;

    // TCP 控制核心
    QTcpSocket *tcpSocket;
    QString serverIP = "192.168.50.236";
    quint16 serverPort = 9012;

};

#endif // WIDGET_FUNCB_SMART_VISION_H

